package itman.elm.service.impl;

import itman.elm.dao.impl.OrderDetailetDaoImpl;
import itman.elm.po.OrderDetailet;
import itman.elm.service.OrderDetailetService;
import itman.elm.service.OrdersService;
import itman.elm.utils.DBUtil;

import java.util.ArrayList;
import java.util.List;

public class OrderDetailetServiceImpl implements OrderDetailetService {
    @Override
    public List<OrderDetailet> listOrderDetailetByOrderId(Integer orderId) {
        List<OrderDetailet> list = new ArrayList<>();
        OrderDetailetDaoImpl dao = new OrderDetailetDaoImpl();
        try {
            DBUtil.getConnection();
            list = dao.listOrderDetailetByOrderId(orderId);
        }catch (Exception e){
            e.printStackTrace();
        } finally {
            DBUtil.close();
        }
        return list;
    }
}
